<html>
    <body>
        <div id=test></div>
        <script>
            function reqListener () {
                document.getElementById("test").innerText = this.responseText;
            }

            var oReq = new XMLHttpRequest();
            oReq.addEventListener("load", reqListener);
            oReq.open("POST", "./mock/post");
            oReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            oReq.send("foo=bar&lorem=ipsum");
        </script>
    </body>
</html>